#include "widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
{
    player = new QMediaPlayer;
    player->setMedia(QUrl::fromLocalFile("E:/audio/39.mp3"));
    player->setVolume(50);
    player->play();


    //无效代码
    player2 = new QMediaPlayer;
    playlist = new QMediaPlaylist(player2);
    playlist->addMedia(QUrl::fromLocalFile("E:/audio/37.mp3"));
    playlist->addMedia(QUrl::fromLocalFile("E:/audio/38.mp3"));

    playlist->setCurrentIndex(1);
    player2->play();
}

Widget::~Widget()
{
}

